package com.rmfyzxfw.caseprocess.service.impl;

import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rmfyzxfw.caseprocess.model.cmd.DataFieldCmd;
import com.rmfyzxfw.caseprocess.model.converter.DataFieldConverter;
import com.rmfyzxfw.caseprocess.model.po.DataField;
import com.rmfyzxfw.caseprocess.service.DataFieldService;
import com.rmfyzxfw.caseprocess.mapper.DataFieldMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
* @author GYW
* @description 针对表【t_data_field(字段表)】的数据库操作Service实现
* @createDate 2024-08-15 10:39:46
*/
@Service
@RequiredArgsConstructor
public class DataFieldServiceImpl extends ServiceImpl<DataFieldMapper, DataField>
    implements DataFieldService{
    private final DataFieldConverter dataFieldConverter;
    @Override
    public void addDataItemField(DataFieldCmd fieldCmd) {
        DataField dataField = dataFieldConverter.cmd2do(fieldCmd);
        dataField.setDataFieldId(IdUtil.simpleUUID());
        this.save(dataField);
    }
}




